package com.swak.vertx.security.principal;

import java.util.concurrent.CompletionStage;

import org.springframework.beans.factory.annotation.Autowired;

import com.swak.annotation.FluxService;
import com.swak.security.Subject;
import com.swak.security.Token;
import com.swak.vertx.security.Context;

@FluxService(context = com.swak.annotation.Context.IO)
public class FluxPrincipalStrategy {

	@Autowired
	PrincipalStrategy principalStrategy;

	public CompletionStage<Subject> createSubject(Context context) {
		return principalStrategy.createSubject(context);
	}

	public CompletionStage<Token> generateToken(Subject subject) {
		return principalStrategy.generateToken(subject);
	}

	public CompletionStage<Token> disposeToken(Subject subject) {
		return principalStrategy.disposeToken(subject);
	}
}
